﻿using MediatR;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using SheepStorage.API.Application.Command.SheepHybridizationCommand;
using SheepStorage.API.Baseclass;
using SheepStorage.Domain.Dto.InputDto;
using SheepStorage.Domain.DTO.InputDto;
using SheepStorage.Domain.DTO.Output;
using SheepStorage.Domain.Entity;
using SheepStorage.Service.Interface;

namespace SheepStorage.API.Controllers
{
    /// <summary>
    /// 种母配种
    /// </summary>
    [Route("api/[controller]/[action]")]
    [ApiController]
    public class SheeepHybridizationController : ControllerBase
    {
        ISheepHybridizationService _res;
        IMediator _mediator;

        public SheeepHybridizationController(ISheepHybridizationService res, IMediator mediator)
        {
            _res = res;
            _mediator = mediator;
        }


        /// <summary>
        /// 判断三代不能配种
        /// </summary>
        /// <param name="momsheep">种母耳号</param>
        /// <returns>可以配种的种公耳号列表</returns>
        [HttpPost]
        public async Task<Results<List<SheepRecord>>> Sho(SheepHybridizationJudgeCommand command)
        {
            return  await _mediator.Send(command);
        }
        /// <summary>
        /// 种母配种显示
        /// </summary>
        /// <param name="command"></param>
        /// <returns></returns>
        [HttpPost]
        public async Task<Results<List<SheepMomHybridizationOutput>>> shows(SheepHybridizationShowCommand command)
        {
            return await _mediator.Send(command);
        }
        /// <summary>
        /// 种母配种添加
        /// </summary>
        /// <param name="command"></param>
        /// <returns></returns>
        [HttpPost]
        public async Task<Results<int>> Add(AddSheepHybridizationCommand command)
        {
            return await _mediator.Send(command);
        }

        /// <summary>
        /// 种母配种删除
        /// </summary>
        /// <param name="command"></param>
        /// <returns></returns>
        [HttpPost]
        public async Task<Results<int>> Del(DelSheepHybridzationCommand command)
        {
            return await _mediator.Send(command);
        }


        /// <summary>
        /// 批量审批
        /// </summary>
        /// <param name="command"></param>
        /// <returns></returns>
        [HttpPost]
        public async Task<Results<int>> UpdCheck(UpdCheckCommand command)
        {
            return await _mediator.Send(command);
        }




    }
}
